package com.digua.base.socket.request

import org.java_websocket.client.WebSocketClient
import org.java_websocket.framing.Framedata


class CollectionFrameDataRequest : Request<Collection<Framedata>> {
    private var data: Collection<Framedata>? = null

    override fun setRequestData(data: Collection<Framedata>) {
        this.data = data
    }

    override fun getRequestData(): Collection<Framedata>? = data

    override fun send(client: WebSocketClient?) {
        client?.sendFrame(data)
    }

    override fun release() {
        RequestFactory.releaseCollectionFrameRequest(this)
    }

    override fun toString() = "[@CollectionFrameDataRequest${hashCode()},Collection<Framedata>:${data?.let { "${it.size.toString()} length" } ?: "null"}]"
}